<template>
  <!-- <div class="share-title tac mb24">
    未命名对话
    <span>2024-07-10</span>
  </div> -->
  <div class="container">

    <Room class="message-list" />
  </div>
  <!-- <div class="message-list">
    <MessageItem
      v-for="(chat, index) in [
        {
          message: '12345633333sssss',
          nodeType: 1,
          isAnswer: true,
          answerState: 5,
          type: 'received',
          text: '321654987',
          isHistory: true,
          replyState: 2
        },
        {},
        {}
      ]"
      :key="chat"
      v-bind="chat"
    />
  </div> -->
  <div class="from-share-btns">
      <router-link class="btn-normal" to="/applyTest">申请试用</router-link>
      <span @click="goLogin" class="btn-primary">用户登录</span>
  </div>
</template>

<script setup lang="ts">
import { useRouter,useRoute } from 'vue-router';

const router = useRouter()
const route = useRoute()
const goLogin = () => {
  router.replace({
    path: '/',
    query: {
      // 这里加一个参数，对话 id ，到时候登录成功之后跳转到这个对话
      redirect: `/chat/loginShareMessage/${ route.params.id }`
    }
  })
}
</script>

<style lang="scss" scoped>
.share-title {
  position: relative;
  height: 60px;
  padding: 20px 24px 12px;
  color: #0d1c2e;
  font-style: 16px;
  font-weight: 500;
  &:after {
    content: '';
    position: absolute;
    left: 24px;
    top: auto;
    bottom: 0;
    right: auto;
    height: 1px;
    width: calc(100vw - 48px);
    background-color: #e7e9ec;
  }
  span {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #5c5e61;
  }
}
.container {
  :deep() {
    .chat-room-container {
      height: calc(100vh - 100px);
      overflow: hidden;
      margin: 0 auto 20px;
    }
  }
}
.from-share-btns {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  span,
  .btn-normal {
    cursor: pointer;
    flex: 1;
    max-width: 48%;
    text-align: center;
    padding: 8px 0;
    border: 1px solid #3c7bff;
    border-radius: 4px;
    background-color: #fff;
    color: #3c7bff;
  }
  .btn-primary {
    background-color: #3c7bff;
    color: #fff;
  }
}
</style>
